<?
	if($_GET) {
		$directory = str_replace('ajax','',dirname(__FILE__));
		require_once($directory . "functions.php");
		extract($_GET);
		if($action == 'posts_table') {
			if(!$status) {
				$status = 'publish';
			}
			$the_posts = drizzo_get_the_posts($limit,$offset,$status);
?>
<table id="blog_posts">
	<tr id="first">
		<th class="center">ID</th><th>Title</th><th>Tags</th><th>Created</th><th class="center">Comments</th><th class="center">Author</th><th class="center" colspan="3">Action</th>
	</tr>
<?
			if(count($the_posts) > 0) {
				foreach($the_posts as $the_post) {
					extract($the_post);
					if ($alt_count%2) { 
						echo "<tr class=\"alt\">\n";
					} else {
						echo "<tr>\n";
					}
					echo "\t<td class=\"center\">" . $ID . "</td>";
					if($the_post['type'] == 'aside') {
						echo "<td class=\"aside\">" . $title . "</td>";
					} else {
						echo "<td>" . $title . "</td>";
					}
					echo "<td>" . drizzo_post_tags() . "</td><td>" . $posted_date . "</td><td class=\"center\" width=\"1\">" . $comment_count . "</td><td class=\"center\" width=\"1\">" . drizzo_post_author('nice_name') . "</td><td class=\"center\" width=\"1\"><a href=\"" . drizzo_post_permalink() ."\" title=\"View This Posts\"><img src=\"" . $drizzo_admin_images . "view.png\" alt=\"View This Post\" /></a></td><td class=\"center\" width=\"1\">" . drizzo_edit_link_backend() . "</td><td class=\"center\" width=\"1\">" . drizzo_delete_link_backend() . "</td>\n";
					echo "</tr>\n";
					$alt_count++;
				}
			}

			if(count($the_posts) == 0) {
				echo "<tr>\n";
				echo "\t<td colspan=\"9\">No Posts were found.</td>\n";
				echo "</tr>\n";
			}
?>					
</table>
<?
		} elseif($action == 'pages_table') {
			drizzo_pages_table($status);
		}
	}
?>